#include <tsg.h>
#include "Xml.h"

using namespace tsg;
using namespace controller;
using namespace gl;

#include <iostream>

#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>

#include "Carousel.h"
#include "LinearFunction.h"
#include "Oscillator.h"
#include "TimeController.h"

int main (int argc, char* argv[])
{
	if(argc!=2)
		return 1;

	//create the root
	Group* root= new Separator();

	//create the xml object that gonnna read the xml file and fill the root
	CXml* myXmlData=new CXml();
	string dataFile(argv[1]);
	//string dataFile("data.xml");
	myXmlData->open(dataFile);
	
	//read the file and fill the root
	if(!myXmlData->read(root, 0))
		return 1;

	display(root, myXmlData->m_windowWidth, myXmlData->m_windowHeight);
	

	//_CrtDumpMemoryLeaks();
	return 0;
}